﻿@using SquishIt.Framework
@using SquishIt.Mvc
@using WebExtras.DemoApp.App_Start
@model WebExtras.DemoApp.Models.Core.JQPlotViewModel

@{
  ViewBag.Title = "jqPlot";
}

@section scripts
{
  @Bundle.JavaScript().MvcRenderCachedAssetTag(ContentBundle.JSjqPlot.GetStringValue())
}


<h3 class="keep-center">jqPlot Bindings</h3>

<div class="row-fluid">
  <div class="span6">
    <div class="row-fluid">
      <div class="span3">
        <strong>Assembly</strong>
      </div>
      <div class="span4">
        WebExtras.dll
      </div>
    </div>
    <div class="row-fluid">
      <div class="span3">
        <strong>Namespace</strong>
      </div>
      <div class="span4">
        WebExtras.JQPlot
      </div>
    </div>
  </div>
  <div class="span6">
    <div class="span3">
      <strong>Dependancies</strong>
    </div>
    <div class="span6">
      <ul class="dependancies">
        <li>Appropriate third party libraries</li>
        <li>webextras.bootstrap.css</li>
      </ul>
    </div>
  </div>
</div>

<div class="row-fluid">
  <div class="span9">
    Steps involved in creating a jqPlot graph
    <ul>
      <li>Creating graph options</li>
      <li>Creating graph data</li>
      <li>Rendering the graph</li>
    </ul>
  </div>
</div>

<ul id="jqPlot-nav" class="nav nav-pills">
  <li>@Html.Hyperlink("Basic Line Graph", MVC.Bootstrap.Core.JQPlot(0))</li>
  <li>@Html.Hyperlink("Non-numeric Axis Values", MVC.Bootstrap.Core.JQPlot(1))</li>
  <li>@Html.Hyperlink("Bar Graphs", MVC.Bootstrap.Core.JQPlot(2))</li>
  <li>@Html.Hyperlink("Multiple Axes", MVC.Bootstrap.Core.JQPlot(3))</li>
  <li>@Html.Hyperlink("Ajax Data", MVC.Bootstrap.Core.JQPlot(4))</li>
  <li>@Html.Hyperlink("OHLC Graph", MVC.Bootstrap.Core.JQPlot(5))</li>
</ul>

<script type="text/javascript">
  $(document).ready(function () {
    $('#jqPlot-nav li:eq(' + @Model.DisplayMode + ')').addClass('active');
  });
</script>

@switch (Model.DisplayMode)
{
  case 1:
  @Html.Partial(MVC.Core.Views._JQPlotNonNumericAxisValues, Model.Charts)
    break;

  case 2:
  @Html.Partial(MVC.Core.Views._JQPlotBarGraph, Model.Charts)
    break;

  case 3:
  @Html.Partial(MVC.Core.Views._JQPlotMultipleAxes, Model.Charts[0])
    break;

  case 4:
  @Html.Partial(MVC.Core.Views._JQPlotAjaxData, Model.Charts[0])
    break;

  case 5:
  @Html.Partial(MVC.Core.Views._JQPlotOHLCGraph, Model.Charts[0])
    break;
    
  default:
  @Html.Partial(MVC.Core.Views._JQPlotLineGraph, Model.Charts[0])
    break;
}
